from utils.page_base import PageBase

from selenium.webdriver.common.by import By

#首页 页面类
class PageIndex(PageBase):
    url="/"
    loc_login=By.CSS_SELECTOR,"a[href='/simple/login']"
    loc_searchKw=By.NAME,"word"


    def __init__(self,driver,base_url):
        PageBase.__init__(self,driver,base_url)

    #打开当前页面
    def openUrl(self):
        self.open(PageIndex.url)

    #点击“登录”按钮
    def click_login(self):
       self.click(PageIndex.loc_login)

    #给搜索框输入关键字并回车
    def input_searchKwAndEnter(self,kw):
        self.inputAndEnter(PageIndex.loc_searchKw,kw)

